﻿using System.ComponentModel;
using System;

namespace DevExpress.CrmDemo.Win.Data {
    public class TeamMemberStatDetail : INotifyPropertyChanged {
        #region Public members

        public int TeamMemberId {
            get { return _teamMemberId; }
            set {
                _teamMemberId = value;
                InvokePropertyChanged("TeamMemberId");
            }
        }

        public DateTime Date {
            get { return _date; }
            set {
                _date = value;
                InvokePropertyChanged("Date");
            }
        }

        public string DateString {
            get { return _dateString; }
            set {
                _dateString = value;
                InvokePropertyChanged("DateString");
            }
        }

        public long Amount {
            get { return _amount; }
            set {
                _amount = value;
                InvokePropertyChanged("Amount");
            }
        }

        #endregion

        #region INotifyPropertyChanged implementation
        public event PropertyChangedEventHandler PropertyChanged;

        private void InvokePropertyChanged(string name) {
            PropertyChangedEventHandler handler = PropertyChanged;
            if(handler != null) handler(this, new PropertyChangedEventArgs(name));
        }
        #endregion

        #region Private data

        private int _teamMemberId;
        private long _amount;
        private string _dateString;
        private DateTime _date;

        #endregion

    }

    public class TeamMemberStatDetailList : BindingList<TeamMemberStatDetail> { }
}
